The BITMAPINFOHEADER contains information about the color space and dimensions of a DIB.
[StructLayout(LayoutKind.Sequential)]
public struct BITMAPINFOHEADER
{
public uint biSize;
public int biWidth;
public int biHeight;
public ushort biPlanes;
public ushort biBitCount;
public uint biCompression;
public uint biSizeImage;
public int biXPelsPerMeter;
public int biYPelsPerMeter;
public uint biClrUsed;
public uint biClrImportant;
public void Init()
{
biSize = Marshal.SizeOf(this);
}
}
StructLayout(LayoutKind.Explicit)> Public Structure BITMAPINFOHEADER
<FieldOffset(0)> Public biSize As Int32
<FieldOffset(4)> Public biWidth As Int32
<FieldOffset(8)> Public biHeight As Int32
<FieldOffset(12)> Public biPlanes As Int16
<FieldOffset(14)> Public biBitCount As Int16
<FieldOffset(16)> Public biCompression As Int32
<FieldOffset(20)> Public biSizeImage As Int32
<FieldOffset(24)> Public biXPelsperMeter As Int32
<FieldOffset(28)> Public biYPelsPerMeter As Int32
<FieldOffset(32)> Public biClrUsed As Int32
<FieldOffset(36)> Public biClrImportant As Int32
End Structure
None.
This is one of those structures where the size of the structure must be set before the structure
can be used by the API. A user should call the Init() method before using this structure in an API call.
(Thanks to Mike I for the VB.NET definition).
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_1rw2.asp